#include<iostream>
using namespace std;
class A {
public:
	int _a;
};
class B : virtual public A {
public:
	int _b;
};
class C : virtual public A {
public:
	int _c;
};
class D : public B, public C {
public:
	int _d;
};
int main()
{
	D d;
	d.B::_a = 1;
	d.C::_a = 2;
	d._a = 3;
	d._b = 4;
	d._c = 5;
	d._d = 6;

	B b;
	b._a = 7;
	b._b = 8;
	//B的指针指向B对象
	B* p2 = &b;
	//B的指针指向D对象切片
	B* p1 = &d;

	p1->_a++;
	p2->_a++;
	return 0;
}